jdk-tar-install: 
    file.managed: #cp文件到minion端
        - name: /usr/local/src/jdk8-linux-x64.tar.gz
        - source: salt://files/java/jdk-8u102-linux-x64.tar.gz
        - user: root
        - group: root
        - mode: 644

    cmd.run: #执行本地命令
        - name: tar -zxf /usr/local/src/jdk8-linux-x64.tar.gz -C /usr/local/ && chown root.root /usr/local/jdk1.8.0_102 -R && rm /usr/local/jdk -f &&ln -s /usr/local/jdk1.8.0_102/  /usr/local/jdk &&ln -s /usr/local/jdk/bin/java  /usr/bin/java
        - unless: test -d /usr/local/jdk* # 如果目录存在不执行
        - require:
            - file: /usr/local/src/jdk8-linux-x64.tar.gz


jdk-env:  #添加java环境的shell
    cmd.script:
        - name: salt://install/base/jdk/profile.sh
      #  - onlyif: test -d /usr/local/jdk* #如果目录存在执行
